#ifndef MATERIALEDITOR_H
#define MATERIALEDITOR_H


#include <material/materialmanager.h>
#include <qobject.h>
#include <qwidget.h>

class cceMaterialEditorAbstract : public QWidget
{
  Q_OBJECT
protected:
  cceMaterialManager* _manager;

protected:
  cceMaterialEditorAbstract (QWidget* parent = 0);

	void SetChanged (bool changed);

  QString GetEditorName (const QString& name);

public:
  virtual QString GetName () const = 0;
  virtual bool Save () = 0;
  void SetMaterialMananager (cceMaterialManager* manager) { _manager = manager; }

public slots:
  virtual void Close () { }

signals:
  void CloseEditor(cceMaterialItem* item);
  void ShowEditor (cceMaterialItem* item);
  void NameChanged (const QString& name);

  void SaveTextures ();
  void SaveShaders ();
  void SavePrograms ();
  void SaveEffects ();
  void SaveMaterials ();
};

class cceMaterialOverviewAbstract : public QWidget
{
  Q_OBJECT
protected:
  cceMaterialOverviewAbstract (QWidget* parent =0);

public:
  virtual cceMaterialEditorAbstract* CreateEditor (cceMaterialItem* item) = 0;

signals:
  void ShowEditor (cceMaterialItem* item);

};

#endif // MATERIALEDITOR_H
